GdkWaylandWindow: Clear export user data when used
authorJonas Ådahl <jadahl@gmail.com>
Fri, 5 May 2017 11:07:04 +0000 (19:07 +0800)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 8 May 2017 19:41:11 +0000 (15:41 -0400)
It was only cleared when unexported, but we could just as well clear it
when its used too.

https://bugzilla.gnome.org/show_bug.cgi?id=782109

gdk/wayland/gdkwindow-wayland.c

index 82835b595a4b35f8747f6e67e7e89648ffbe91e9..94fb116b1c2633430f68d7d4cdd44c466575bf2c 100644 (file)
@@ -3967,7 +3967,8 @@ xdg_exported_handle (void                    *data,
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
 
   impl->exported.callback (window, handle, impl->exported.user_data);
-  impl->exported.user_data = NULL;
+  g_clear_pointer (&impl->exported.user_data,
+                   impl->exported.destroy_func);
 }
 
 static const struct zxdg_exported_v1_listener xdg_exported_listener = {